hpxAdminApp.factory('fBankService', ['Restangular', function (Restangular) {
    var res = Restangular.all('FBank');
    return {
        get: function (id) {
            return res.one(id).get();
        },
        getBillListForCheck: function (params,filter) {
            var queryParam = {
                'p': params.page(),
                'n': params.count(),
                'orderBy': params.orderBy(),
                'isCheck': filter.bill_status
            }
            return res.get('fBankTrade' + '/getBillListForCheck', queryParam).then(function (result) {
                //params.total(result.page_info.items_number);
                //return result.listName;
                if (result == null) {
                    return result;
                } else {
                    params.total(result.page_info.items_number);
                    return result.listName;
                }
            });
        },
        fBankTrade: function (model) {
            return res.all('fBankTrade').one('checkFMBBill').customPUT(model);
        },
        changeFMBBill: function (model) {
            return res.all('fBankTrade').one('changeFMBBill').customPUT(model);
        },
        getBillOrderList: function (params) {
            var queryParam = {
                'p': params.page(),
                'n': params.count(),
                'orderBy': params.orderBy()
            }
            return res.get('fBankTrade' + '/user/getBillOrderList', queryParam).then(function (result) {
                if (result == null) {
                    return result;
                } else {
                    params.total(result.page_info.items_number);
                    return result.listName;
                }
            });
        }
       
    }
}]);